<?php

namespace App\Http\Middleware;

use App\Facades\AuthService;
use Closure;

/**
 * MemberCheck.
 *
 * @license [http://www.85do.com] [杭州永奥网络科技有限公司]
 * @copyright Copyright (c) 2018-2026 Hangzhou Yongao Technology Co., Ltd. All rights reserved.
 */
class MemberCheck
{

    /**
     * Handle an incoming request.
     *
     * @param \Illuminate\Http\Request $request
     * @param \Closure                 $next
     *
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if(AuthService::check()){
            return redirect('/mc');
        }

        return $next($request);
    }
}
